from django.shortcuts import render
from Merchant.models import *
from Merchant.models import *
# Create your views here.
from rest_framework.views import APIView,Response


class ShoppingEnter(APIView):
    def post(self, request):
        name = request.data.get('name')
        mobile = request.data.get('mobile')
        try:
            Shopping.objects.create(name=name, mobile=mobile)
        except Exception as e:
            print(e)
            return Response(data='入驻异常')
        return Response(data='入驻成功,欢迎您的加入')


class ShoppingAdd(APIView):
    def post(self):
        pass
